home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / clonecd / September 93.img / Archives / Applications / Calculators / AxoCalculator / AxoCalculator Documentation / Procedures and Functions < prev    next >
Text File  |  1993-03-12  |  6KB  |  148 lines

  1.  
  2. Procedures and Functions in AxoCalculator
  3.  
  4. Contents
  5.  
  6. •    Introduction
  7. •    Auto-Loading Custom Functions
  8. •    Built In Functions
  9. •    Built In Procedures
  10.  
  11.  
  12. Introduction
  13. AxoCalculator comes with many built in functions and procedures. These are described below. Additional customized functions and procedures can be added. They are written by the user in a high level language (Pascal, Fortran, Basic or C), then loaded into AxoCalculator. Customized functions and procedures can be loaded manually by selecting the source text then pressing "enter". They can also be loaded automatically every time AxoCalculator is run.
  14.  
  15.  
  16. Auto-Loading Custom Functions
  17.  
  18. When AxoCalculator starts up, it looks for a folder called "AxoCalculator AutoLoad" located in the same folder as the program, and attempts to open and load any text files that it finds in this folder. Files containing frequently used custom functions and procedures should be placed in this folder. After unpacking the "AxoCalculator.sea" package, an auto-load folder is created, and contains a several files including "Unit Conversions". When this file is loaded, it adds several custom functions and programs to AxoCalculator.
  19.  
  20.  
  21.  
  22. Built In Functions
  23.  
  24. Note: The functions in italics  are disabled in 
  25. the no-FPU version of AxoCalculator
  26.  
  27.  
  28. General Functions
  29.  
  30. abs (x)             Absolute value
  31. sqrt (x)           Square root
  32. sqr (x)             Square
  33. exp (x)             Exponential   (e raised to the power x)
  34. ln (x)               Natural Log  (to the base e)
  35. exp10 (x)         10 raised to the power x
  36. log10 (x)         Log to the base 10
  37. trunc (x)          Next lowest integer
  38. round (x)          Nearest integer
  39. odd (i)             Returns TRUE if "i" is an odd number
  40.  
  41.  
  42. Trigonometric
  43.  
  44. pi                    Returns the value of pi  (≈ 3.1415926)
  45. Sin (x)             Sin
  46. Cos (x)            Cos
  47. Tan (x)            Tan
  48. Sinh (x)           Hyperbolic Sin
  49. Cosh (x)           Hyperbolic Cos
  50. Tanh (x)           Hyperbolic Tan
  51. ArcSin (x)        Inverse Sin
  52. ArcCos (x)       Inverse Cos
  53. ArcTan (x)       Inverse Tan
  54.  
  55. Array Functions  
  56.  
  57. av (arr, from, to)                  Average of array elements
  58. mean (arr, from, to)              Same as "av"
  59. variance (arr, from, to)         Variance
  60. stdDev (arr, from, to)            Standard deviation 
  61. stdErr (arr, from, to)            Standard error 
  62. sd (arr, from, to)                  Alternative standard deviation 
  63. sem (arr, from, to)                Alternative standard error 
  64. min (arr, from, to)                Minimum array element
  65. max (arr, from, to)                Maximum array element
  66. count (arr, from, to)             Number of elements processed
  67. arraySize (arr)                      Total number of elements in array
  68.  
  69. Note:    The "from" and "to" parameters are optional. 
  70.         They specify a range of array elements to be processed.
  71.         If they are omitted, the entire array is processed.
  72.         Remember that array indexing in C starts from zero,
  73.         but in all other languages it starts from one.
  74.  
  75.  
  76.  
  77. Built In Procedures
  78.  
  79. Text and Numeric Output
  80.  
  81. •    Write ('A string', a, b, c,...)
  82. •    WriteLn ('A string', a, b, c,...)
  83. •    Print ('A string', a, b, c,...)
  84. •    Printf ('A string', a, b, c,...)
  85.  
  86. These procedures convert their parameter list to a line of text and send it to the front window. "Write" does not add a "return" at the end of the output line. "WriteLn", "Print" and "Printf" are interchangeable. Valid parameters are numerical or logical variables and expressions, and character strings. Any number of parameters may be specified (including none), and strings and numeric variables may appear in any order. Logical variables will be written as "1" (if True) or "0" (if False). 
  87.  
  88.  
  89. Note:    Pascal and Fortran use single quotes ( ' ) to enclose 
  90.         character strings, but Basic and C use double quotes ( " ). 
  91.         To include a quote, tab or return in a character string, 
  92.         use \' or \" for a quote, \t for a tab and \r or \n for a return. 
  93.  
  94.  
  95. • FlushOutput
  96. Text output from Write, WriteLn and Print is normally accumulated in a buffer and output all at once when a program finishes running. Use FlushOutput to force the output to occur while the program is still running. 
  97.  
  98.  
  99.  
  100. Creating Array and String Variables
  101.  
  102. • NewArray (variableName, arrSize)
  103. This procedure creates a new array of size "arrSize", and sets all elements to zero. It provides an alternative to formally declaring an array variable at the start of a program. 
  104.  
  105. • NewString (variableName)
  106. This procedure creates a new 255 character string. It provides an alternative to formally declaring a string variable at the start of a program. String variables can also be created on the fly. For example,
  107.  
  108. aString = 'abc123'
  109.  
  110.  
  111.  
  112. User Dialog
  113.  
  114. • Alert ('A string', a, b, c,...)
  115. This procedure converts its parameter list to a line of text (as for Writeln, Printf, etc.), and sends the text to an alert dialog.
  116.  
  117. • PoseDialog ('Introduction', '1st Param', a1, '2nd Param', a2, ... )
  118. This procedure permits the user to request parameter values via a standard dialog. The parameter list must have the following format. The first parameter is a string containing general information. The next parameter is a string describing the first requested variable. The third parameter is a numeric variable which will receive the requested value. Subsequent parameters are optional, but if present, they must alternate text string, then numeric variable. After executing this procedure, the values entered into the dialog by the user are returned in the numeric variables, "a1", "a2", ... 
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. Array Procedures
  127.  
  128. • WriteArr (arr, from, to)
  129. Write the contents of the array to the front window
  130.  
  131. • Stats (arr, from, to)
  132. Calculate the following summary statistics for the specified array and output the results to the front window : 
  133. Mean, Variance, S.D., S.E.M., Minimum, Maximum and Count.
  134.  
  135. Note: the "from" and "to" parameters are optional. 
  136.          They specify a range of array elements to be processed.
  137.          If they are omitted, the entire array is processed.
  138.  
  139.  
  140.  
  141. General Purpose
  142.  
  143. • beep
  144. Generates the alert sound
  145.  
  146. • Unload (varName, macroName, functionName, ...)
  147. This procedure unloads all the specified global variables, macros, procedures and functions. It frees up memory space allocated to the arrays and procedures. It also removes the specified macro names from the "Calculator" menu. 
  148.